package com.coding.controller;

import com.coding.base.pojo.BaseModel;
import com.coding.service.AgainService;
import com.wordnik.swagger.annotations.ApiOperation;
import com.wordnik.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @auther wangchenghao
 * @date 2020/8/28
 **/
@Controller
@ResponseBody
@RequestMapping("again")
public class AgainController {
    @Autowired
    AgainService againService;

    @ApiOperation(value = "查询所以诗人路线信息")
    @RequestMapping(value = "/selectAll", method = {RequestMethod.GET})
    @ResponseBody
    public BaseModel selectAll(
    ) {
        BaseModel model = new BaseModel();
        try {
            againService.selectAll(model);
        } catch (Exception e) {
            e.printStackTrace();
        }

        return model;
    }

    @ApiOperation(value = "查询所以诗人路线信息")
    @RequestMapping(value = "/selectById", method = {RequestMethod.GET})
    @ResponseBody
    public BaseModel selectById(@ApiParam(value = "again_id", required = true) @RequestParam("again_id") int again_id
    ) {
        BaseModel model = new BaseModel();
        try {
            againService.selectById(again_id,model);
        } catch (Exception e) {
            e.printStackTrace();
        }

        return model;
    }
}
